package com.freight.order.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.freight.core.base.FreightBaseEntity;
import com.freight.core.common.utils.SnowFlakeUtil;
import com.freight.order.constant.OrderStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @author huyingtai
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "order_goods")
@TableName("order_goods")
@ApiModel(value = "货物需求信息")
public class OrderGoods extends FreightBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "货源号")
    private String goodNo = String.valueOf(SnowFlakeUtil.nextId());

    @ApiModelProperty(value = "货主Id")
    private Long companyUserId;

    @ApiModelProperty(value = "货物一级类型")
    private String goodType;

    @ApiModelProperty(value = "货物名称")
    private String goodSubType;

    @ApiModelProperty(value = "剩余货物重量")
    private double goodWeight;

    @ApiModelProperty(value = "备注")
    private String content;

    @ApiModelProperty(value = "拒绝原因")
    private String refuseReason;

    @ApiModelProperty(value = "状态 需求状态起始是 0待审核 1已拒绝  3进行中 4已关闭 5已完结 -1已删除")
    private Integer status = OrderStatus.GOODS_BEGIN;

    @ApiModelProperty(value = "起始县区列表")
    private String beginAreaCode;

    @ApiModelProperty(value = "起始地址")
    private String beginAddress;

    @ApiModelProperty(value = "结束县区列表")
    private String endAreaCode;

    @ApiModelProperty(value = "结束地址")
    private String endAddress;

    @ApiModelProperty(value = "收货人名称")
    private String takeName;

    @ApiModelProperty(value = "收货联系人名称")
    private String takeContactName;

    @ApiModelProperty(value = "收货人电话")
    private String takePhone;

    @ApiModelProperty(value = "提货人单位名称")
    private String extractName;

    @ApiModelProperty(value = "提货联系人名称")
    private String extracContactName;

    @ApiModelProperty(value = "提货人电话")
    private String extractPhone;

    @ApiModelProperty(value = "装货经度")
    private Double beginLng;

    @ApiModelProperty(value = "装货纬度")
    private Double beginLat;

    @ApiModelProperty(value = "卸货经度")
    private Double endLng;

    @ApiModelProperty(value = "卸货纬度")
    private Double endLat;

    @ApiModelProperty(value = "装货电子围栏")
    private Double pretendEnclosure;

    @ApiModelProperty(value = "卸货电子围栏")
    private Double dischargeEnclosure;

    @ApiModelProperty(value = "运费单价")
    private BigDecimal freightUnitPrice;

    @ApiModelProperty(value = "货物总重量")
    private double totalGoodWeight;

    @ApiModelProperty(value = "运输时效")
    private double prescription;

    @ApiModelProperty(value = "计价单位 1按重量 2按体积 3按件数")
    private String valuationUnit;

    @ApiModelProperty(value = "体积")
    private Double volume;

    @ApiModelProperty(value = "件数")
    private Double piece;
}